package com.sino.second.struts2;

import java.util.Date;
import java.util.List;
import java.util.Map;


import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.sino.bean.Basicinfo;
import com.sino.business.service.LoginInfo;
import com.sino.model.BasicInfoModel;
import com.sino.model.StaticModel;
import com.sino.second.bean.TblXmjg1;
import com.sino.second.business.IReviewService;
import com.sino.second.business.IZjpsfpService;
import com.sino.second.business.service.Review1ServiceImpl;
import com.sino.util.DateUtils;
import com.sino.util.SysParameter;

public class ReviewViewAction extends ActionSupport {
	private String zlid;

	private String name;

	private String zlqr;

	private Double avgFenshu;

	private Double sumFenshu;

	private Double orderByFenshu;

	private String year;

	private String psrq;

	private String username;

	private Integer count;
	
	private String xkId;

	private List<StaticModel> staticModelList = null;// 用于存储专业列表

	private IZjpsfpService zjpsfpServiceImp;

	private IReviewService review1ServiceImpl;

	private List<BasicInfoModel> basicInfoList = null;

	public void setZjpsfpServiceImp(IZjpsfpService zjpsfpServiceImp) {
		this.zjpsfpServiceImp = zjpsfpServiceImp;
	}

	/**
	 * 列出所有专业列表
	 * 
	 * @return
	 */
	public String listAllZhuanye() {
		staticModelList = this.zjpsfpServiceImp.listAllZhuanye();
		return SUCCESS;
	}

	/**
	 * xyw 初审项目审核(一)
	 * 
	 * @return
	 */
	public String chuShenXiangMuShenHe() {
		
		ActionContext ctx = ActionContext.getContext();
		Map session = ctx.getSession();
		LoginInfo user = (LoginInfo) session.get("logininfo");
		username = user.getName();
		psrq = new Date().toLocaleString();
		year = SysParameter.CURRENT_YEAR;
		return SUCCESS;
	}

	/**
	 * xyw 初审项目审核(二)
	 * 
	 * @return
	 */
	public String chuShenXiangMuShenHe2() {
		TblXmjg1 tblXmjg1 = new TblXmjg1();
		Basicinfo bi=new Basicinfo();
		// 通过专家专利id查找 该项目的信息
			bi.setZlid(zlid);
        tblXmjg1.setBasicinfo(bi);
		tblXmjg1.setPsrq(DateUtils.getSystemDate());
			
		tblXmjg1.setXmpjf(avgFenshu);
		tblXmjg1.setXmpjpxfx(orderByFenshu);
		tblXmjg1.setXmzf(sumFenshu);
		tblXmjg1.setYear(SysParameter.CURRENT_YEAR);
		tblXmjg1.setUsername(username);
		tblXmjg1.setIspass("1");
		tblXmjg1.setYpzjs(count);
		this.review1ServiceImpl.saveReviewsResults(tblXmjg1);
		return SUCCESS;
	}

	public List<StaticModel> getStaticModelList() {
		return staticModelList;
	}

	public void setStaticModelList(List<StaticModel> staticModelList) {
		this.staticModelList = staticModelList;
	}

	public List<BasicInfoModel> getBasicInfoList() {
		return basicInfoList;
	}

	public void setBasicInfoList(List<BasicInfoModel> basicInfoList) {
		this.basicInfoList = basicInfoList;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getAvgFenshu() {
		return avgFenshu;
	}

	public void setAvgFenshu(Double avgFenshu) {
		this.avgFenshu = avgFenshu;
	}

	public Double getOrderByFenshu() {
		return orderByFenshu;
	}

	public void setOrderByFenshu(Double orderByFenshu) {
		this.orderByFenshu = orderByFenshu;
	}

	public Double getSumFenshu() {
		return sumFenshu;
	}

	public void setSumFenshu(Double sumFenshu) {
		this.sumFenshu = sumFenshu;
	}

	public String getZlqr() {
		return zlqr;
	}

	public void setZlqr(String zlqr) {
		this.zlqr = zlqr;
	}

	public String getZlid() {
		return zlid;
	}

	public void setZlid(String zlid) {
		this.zlid = zlid;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getPsrq() {
		return psrq;
	}

	public void setPsrq(String psrq) {
		this.psrq = psrq;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public void setReview1ServiceImpl(Review1ServiceImpl review1ServiceImpl) {
		this.review1ServiceImpl = review1ServiceImpl;
	}

	public IReviewService getReview1ServiceImpl() {
		return review1ServiceImpl;
	}

	public void setReview1ServiceImpl(IReviewService review1ServiceImpl) {
		this.review1ServiceImpl = review1ServiceImpl;
	}

	public String getXkId() {
		return xkId;
	}

	public void setXkId(String xkId) {
		this.xkId = xkId;
	}
}
